home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / dist-packages / checkbox / plugin.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  1.7 KB  |  40 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import re
  5. from checkbox.component import ComponentManager
  6.  
  7. class PluginManager(ComponentManager):
  8.     '''
  9.     Plugin manager which extends the component to support the concepts
  10.     of a reactor.
  11.     '''
  12.     
  13.     def __init__(self, config, reactor, registry):
  14.         super(PluginManager, self).__init__(config)
  15.         self.reactor = reactor
  16.         self.registry = registry
  17.         self.sections = []
  18.         section_names = self._config.get_defaults().plugins
  19.         for section_name in re.split('\\s+', section_names):
  20.             section = self.load_section(section_name)
  21.             self.sections.append(section)
  22.             for module in section.load_modules():
  23.                 module.register(self)
  24.             
  25.         
  26.  
  27.  
  28.  
  29. class Plugin(object):
  30.     '''
  31.     Plugin base class which should be inherited by each plugin
  32.     implementation. This class extends the component to automatically
  33.     call the run method if defined.
  34.     '''
  35.     
  36.     def register(self, manager):
  37.         self._manager = manager
  38.  
  39.  
  40.